/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.geftu.model;

//import br.com.geftu.util.Coluna;
import com.towel.el.annotation.Resolvable;
import java.io.Serializable;
import javax.persistence.Basic;
//import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author jorgenei
 */
@Entity
@Table(name = "tb_modulo", catalog = "bddefeitos", schema = "public")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Modulo.findAll", query = "SELECT t FROM Modulo t"),
    @NamedQuery(name = "Modulo.findByIdmod", query = "SELECT t FROM Modulo t WHERE t.idmod = :idmod"),
    @NamedQuery(name = "Modulo.findByModulo", query = "SELECT t FROM Modulo t WHERE t.modulo = :modulo"),
    @NamedQuery(name = "Modulo.findByRelease", query = "SELECT t FROM Modulo t WHERE t.release = :release"),
    @NamedQuery(name = "Modulo.findByDtalteracao", query = "SELECT t FROM Modulo t WHERE t.dtalteracao = :dtalteracao"),
    @NamedQuery(name = "Modulo.findByExcluido", query = "SELECT t FROM Modulo t WHERE t.excluido = :excluido")})
public class Modulo implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Resolvable(colName = "ID")
    @SequenceGenerator(name = "idmod", sequenceName = "modulo_seq", allocationSize = 1)
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "idmod")
    private Integer idmod;
    @Resolvable(colName = "Modulo")
    private String modulo;
    @Resolvable(colName = "Release")
    private String release;
    @Resolvable(colName = "Alteracao")
    private String dtalteracao;
    private Boolean excluido;

    @ManyToOne(fetch = FetchType.EAGER, optional = false)
    @JoinColumn(name = "projeto", referencedColumnName = "idproj")
    @Resolvable(colName = "Projeto")
    private Projeto projeto;

    public Modulo() {
    }

    public Modulo(Integer idmod) {
        this.idmod = idmod;
    }

    public Modulo(int idmod, String modulo) {
        this.idmod = idmod;
        this.modulo = modulo;
    }

    public Integer getIdmod() {
        return idmod;
    }

    public void setIdmod(Integer idmod) {
        this.idmod = idmod;
    }

    public String getModulo() {
        return modulo;
    }

    public void setModulo(String modulo) {
        this.modulo = modulo;
    }

    public String getRelease() {
        return release;
    }

    public void setRelease(String release) {
        this.release = release;
    }

    public String getDtalteracao() {
        return dtalteracao;
    }

    public void setDtalteracao(String dtalteracao) {
        this.dtalteracao = dtalteracao;
    }

    public Boolean getExcluido() {
        return excluido;
    }

    public void setExcluido(Boolean excluido) {
        this.excluido = excluido;
    }

    public Projeto getProjeto() {
        return projeto;
    }

    public void setProjeto(Projeto projeto) {
        this.projeto = projeto;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idmod != null ? idmod.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Modulo)) {
            return false;
        }
        Modulo other = (Modulo) object;
        if ((this.idmod == null && other.idmod != null) || (this.idmod != null && !this.idmod.equals(other.idmod))) {
            return false;
        }
        return true;
    }
    


    @Override
    public String toString() {
        return modulo;
    }

}
